home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-05 / lanutsrc.zip / LANCTL.ASM < prev    next >
Assembly Source File  |  1991-03-13  |  4KB  |  166 lines

  1. ; ***************************************************************************
  2. ; LANCTL.ASM - More Assembly language functions for LANtastic
  3. ; 8/31/89 JEM
  4. ; 2/18/91 JEM Updated for MASM 5.1
  5. ; ***************************************************************************
  6. .MODEL COMPACT,C
  7. .CODE
  8.  
  9. time_block    struc
  10.  TB_year    dw ?                ; Year
  11.  TB_day        db ?                ; Day of month (1-31)
  12.  TB_month    db ?                ; Month (1-12)
  13.  TB_minutes    db ?                ; Minutes (0-59)
  14.  TB_hour    db ?                ; Hour (0-23)
  15.  TB_hundreths    db ?                ; Hundreths of seconds (0-99)
  16.  TB_seconds    db ?                ; Seconds (0-59)
  17. time_block    ends
  18.  
  19. ;
  20. ; Name:     get_message
  21. ; Function: Gets the last unsolicited network message.  Returns 0
  22. ;           if successful, error code otherwise.
  23. ; Caller:   MS C compact model
  24. ; Args:     get_message(buffer);
  25. ;        far char *buffer;
  26. ; Author:   JEM
  27. ; Date:     8/18/89
  28. ;
  29. get_message PROC NEAR USES ES DI DS SI, buffer:PTR
  30.  
  31. ; Call LANOS get message function
  32.         les    di,buffer
  33.     mov    ax,5F99H
  34.     int    21H
  35.     
  36. ; process the result
  37.     jc    GLM_DONE         ; if CS, we have a problem
  38.     xor     ax,ax            ; else, return 0
  39.  
  40. ; we're done -- clean up and go home
  41. GLM_DONE:
  42.         ret
  43. get_message ENDP
  44.  
  45. ;
  46. ; Name:        lpt_timeout
  47. ; Function: Sets the network printer timeout, in seconds
  48. ; Caller:   MSC 4.0, Compact
  49. ; Args:     lpt_timeout(seconds);
  50. ;          int seconds;
  51. ; Author:   JM
  52. ; Date:     8/31/89
  53. lpt_timeout PROC NEAR USES ES DI DS SI, seconds:WORD
  54.     
  55.         mov    ax,seconds        ; load time in seconds
  56.         mov    cx,18                   ;  * 18.2 ticks/second
  57.         mul    cx                      ; convert to clock ticks
  58.         mov    cx,ax            ; store in CX
  59.         mov    ax,5FD1h        ; Set timeout fn
  60.         int    21h            ; Set the timeout
  61.         ret
  62. lpt_timeout ENDP
  63.  
  64.  
  65. ;
  66. ; Name:        set_clock
  67. ; Function: Sets a station's time from the specified server
  68. ; Caller:   MSC 4.0, Compact
  69. ; Args:     set_clock(server)
  70. ;        char *server;
  71. ; Author:   JM
  72. ; Date:     
  73.  
  74. set_clock PROC NEAR USES ES DI DS SI, server:PTR
  75.         LOCAL tb[4]:WORD
  76.  
  77.     les    di,server        ; ES:DI points to server name
  78.  
  79.         mov     si,ss
  80.         mov     ds,si 
  81.         mov     si, bp
  82.         sub     si, 8            ; DS:SI points to time block
  83.  
  84.     mov    ax,5FC0h        ; Get server time fcn.
  85.     int    21h            ; get the server's time stamp
  86.     
  87. ; Set the station's date
  88.     mov    ah,2Bh            ; set date fn
  89.     mov    cx,[si].TB_year
  90.     mov    dh,[si].TB_month
  91.     mov    dl,[si].TB_day
  92.     int    21h            ; Set the date
  93.     
  94. ; Set the station's time
  95.     mov    ah,2Dh            ; set time fn.
  96.     mov    ch,[si].TB_hour
  97.     mov    cl,[si].TB_minutes    
  98.     mov    dh,[si].TB_seconds
  99.     mov    dl,[si].TB_hundreths
  100.     int    21h            ; Set the time
  101.         ret
  102. set_clock ENDP
  103.  
  104. ;
  105. ; Name:        set_lpt_mode
  106. ; Function: 
  107. ; Caller:   MSC 4.0, Compact
  108. ; Args:     set_lpt_mode(mode)
  109. ;        
  110. ; Author:   JM
  111. ; Date:     
  112. set_lpt_mode PROC NEAR USES ES DI DS SI, mode:WORD
  113.     mov    dl,byte ptr (mode)    ; 0 = combined, 1 = separate
  114.     mov    ax,5D08h        ; set prt mode fn
  115.     int     21h            ; do it!
  116.         ret
  117. set_lpt_mode ENDP
  118.  
  119. ;
  120. ; Name:        flush_lpt
  121. ; Function: 
  122. ; Caller:   MSC 4.0, Compact
  123. ; Args:     flush_lpt()
  124. ;        
  125. ; Author:   JM
  126. ; Date:     
  127. flush_lpt PROC NEAR USES ES DI DS SI
  128.     mov    ax,5D09h        ; flush printer function
  129.     int    21h
  130.         ret
  131. flush_lpt ENDP
  132.  
  133. ;
  134. ; Name:        queue_ctl
  135. ; Function: 
  136. ; Caller:   MSC 4.0, Compact
  137. ; Args:     queue_ctl(command,server)
  138. ;        
  139. ; Author:   JM
  140. ; Date:     
  141. queue_ctl PROC NEAR USES ES DI DS SI, command:WORD, server:PTR
  142.      mov    bl,byte ptr (command)
  143.      les    di,server
  144.      mov    ax,5FA2h
  145.      int    21h
  146.         ret
  147. queue_ctl ENDP
  148.  
  149. ;
  150. ; Name:        audit
  151. ; Function: Create user audit file entry
  152. ; Caller:   MSC 4.0, Compact
  153. ; Args:     audit(server,reason,entry)
  154. ;        char *server,*reason,*entry;
  155. ; Author:   JM
  156. ; Date:     
  157. audit PROC NEAR USES ES DI DS SI, server:PTR, reason:PTR, entry:PTR
  158.     les    di,server        
  159.     lds    dx,reason
  160.     lds    si,entry
  161.     mov    ax,5FA7h        ; create user audit entry
  162.     int    21h
  163.         ret
  164. audit ENDP
  165. END
  166.